#include<REG51.H>
#include <intrins.h> 
unsigned char STEPS[]={
	0x18,//0001 1000
	//0x1c,//0001 1100
	0x14,//0001 0100
	//0x16,//0001 0110
	0x12,//0001 0010
	//0x13,//0001 0011
	0x11,//0001 0001
	//0x19 //0001 1001
	0x88,//1000 1000
	0x48,//0100 1000
	0x28,//0010 1000
	0x18,//0001 1000
};


void delay100ms()		//@12.000MHz
{
	unsigned char i, j, k;

	_nop_();
	_nop_();
	i = 5;
	j = 144;
	k = 71;
	do
	{
		do
		{
			while (--k);
		} while (--j);
	} while (--i);
}

void delay10ms()		//@12.000MHz
{
	unsigned char i, j;

	i = 117;
	j = 184;
	do
	{
		while (--j);
	} while (--i);
}

	
void main(){
	unsigned char step=0x01;
	
	
	P2=0X00;
	while(1){
	
		delay100ms();
		P3 = step;
		
		step=step<<1;
		
		if(step==0){
			step=0x01;
		}
		//P3=STEPS[step];
		//P2=STEPS[step];
		//P2 ^=0XFF;
		//step++;
		//if(step==8){
		//	step=0;
		//}
	}
	
}